var that;
class Tab {
  constructor(id) {
    that = this;

    that.main = document.querySelector(id);

    that.lis = document.querySelectorAll("li");
    that.sections = document.querySelectorAll("section");

    that.init();
  }

  init() {
    for(let i = 0; i < that.lis.length; i++){
      that.lis[i].onclick = that.toggleTab;
      that.lis[i].index = i;
    }
  }
  // 界面切换
  toggleTab() {
    for(let j = 0; j < that.lis.length; j++){
      that.sections[j].className = "";
    }
    that.sections[this.index].className = "conactive";
  }

  removeTab() {

  }

  addTab() {

  }

  updateTab() {

  }
}

new Tab("#tab");